(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

U11(tt, M, N) → U12(tt, activate(M), activate(N))
U12(tt, M, N) → s(plus(activate(N), activate(M)))
U21(tt, M, N) → U22(tt, activate(M), activate(N))
U22(tt, M, N) → plus(x(activate(N), activate(M)), activate(N))
plus(N, 0) → N
plus(N, s(M)) → U11(tt, M, N)
x(N, 0) → 0
x(N, s(M)) → U21(tt, M, N)
activate(X) → X

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

U11(tt, M, N) → U12(tt, activate(M), activate(N)) [1]
U12(tt, M, N) → s(plus(activate(N), activate(M))) [1]
U21(tt, M, N) → U22(tt, activate(M), activate(N)) [1]
U22(tt, M, N) → plus(x(activate(N), activate(M)), activate(N)) [1]
plus(N, 0) → N [1]
plus(N, s(M)) → U11(tt, M, N) [1]
x(N, 0) → 0 [1]
x(N, s(M)) → U21(tt, M, N) [1]
activate(X) → X [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

U11(tt, M, N) → U12(tt, activate(M), activate(N)) [1]
U12(tt, M, N) → s(plus(activate(N), activate(M))) [1]
U21(tt, M, N) → U22(tt, activate(M), activate(N)) [1]
U22(tt, M, N) → plus(x(activate(N), activate(M)), activate(N)) [1]
plus(N, 0) → N [1]
plus(N, s(M)) → U11(tt, M, N) [1]
x(N, 0) → 0 [1]
x(N, s(M)) → U21(tt, M, N) [1]
activate(X) → X [1]

The TRS has the following type information:
U11 :: tt → s:0 → s:0 → s:0
tt :: tt
U12 :: tt → s:0 → s:0 → s:0
activate :: s:0 → s:0
s :: s:0 → s:0
plus :: s:0 → s:0 → s:0
U21 :: tt → s:0 → s:0 → s:0
U22 :: tt → s:0 → s:0 → s:0
x :: s:0 → s:0 → s:0
0 :: s:0

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:
none

(c) The following functions are completely defined:


activate
x
U21
U22
plus
U11
U12

Due to the following rules being added:
none

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

U11(tt, M, N) → U12(tt, activate(M), activate(N)) [1]
U12(tt, M, N) → s(plus(activate(N), activate(M))) [1]
U21(tt, M, N) → U22(tt, activate(M), activate(N)) [1]
U22(tt, M, N) → plus(x(activate(N), activate(M)), activate(N)) [1]
plus(N, 0) → N [1]
plus(N, s(M)) → U11(tt, M, N) [1]
x(N, 0) → 0 [1]
x(N, s(M)) → U21(tt, M, N) [1]
activate(X) → X [1]

The TRS has the following type information:
U11 :: tt → s:0 → s:0 → s:0
tt :: tt
U12 :: tt → s:0 → s:0 → s:0
activate :: s:0 → s:0
s :: s:0 → s:0
plus :: s:0 → s:0 → s:0
U21 :: tt → s:0 → s:0 → s:0
U22 :: tt → s:0 → s:0 → s:0
x :: s:0 → s:0 → s:0
0 :: s:0

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

U11(tt, M, N) → U12(tt, M, N) [3]
U12(tt, M, N) → s(plus(N, M)) [3]
U21(tt, M, N) → U22(tt, M, N) [3]
U22(tt, M, N) → plus(x(N, M), N) [4]
plus(N, 0) → N [1]
plus(N, s(M)) → U11(tt, M, N) [1]
x(N, 0) → 0 [1]
x(N, s(M)) → U21(tt, M, N) [1]
activate(X) → X [1]

The TRS has the following type information:
U11 :: tt → s:0 → s:0 → s:0
tt :: tt
U12 :: tt → s:0 → s:0 → s:0
activate :: s:0 → s:0
s :: s:0 → s:0
plus :: s:0 → s:0 → s:0
U21 :: tt → s:0 → s:0 → s:0
U22 :: tt → s:0 → s:0 → s:0
x :: s:0 → s:0 → s:0
0 :: s:0

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

tt => 0
0 => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, M, N) :|: z' = M, z = 0, z'' = N, M >= 0, N >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(N, M) :|: z' = M, z = 0, z'' = N, M >= 0, N >= 0
U21(z, z', z'') -{ 3 }→ U22(0, M, N) :|: z' = M, z = 0, z'' = N, M >= 0, N >= 0
U22(z, z', z'') -{ 4 }→ plus(x(N, M), N) :|: z' = M, z = 0, z'' = N, M >= 0, N >= 0
activate(z) -{ 1 }→ X :|: X >= 0, z = X
plus(z, z') -{ 1 }→ N :|: z = N, z' = 0, N >= 0
plus(z, z') -{ 1 }→ U11(0, M, N) :|: z' = 1 + M, z = N, M >= 0, N >= 0
x(z, z') -{ 1 }→ U21(0, M, N) :|: z' = 1 + M, z = N, M >= 0, N >= 0
x(z, z') -{ 1 }→ 0 :|: z = N, z' = 0, N >= 0

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ activate }
{ plus, U12, U11 }
{ U22, x, U21 }

(14) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {activate}, {plus,U12,U11}, {U22,x,U21}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: activate
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(16) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {activate}, {plus,U12,U11}, {U22,x,U21}
Previous analysis results are:
activate: runtime: ?, size: O(n1) [z]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: activate
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(18) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {plus,U12,U11}, {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {plus,U12,U11}, {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: plus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

Computed SIZE bound using CoFloCo for: U12
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z' + z''

Computed SIZE bound using CoFloCo for: U11
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z' + z''

(22) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {plus,U12,U11}, {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]
plus: runtime: ?, size: O(n1) [z + z']
U12: runtime: ?, size: O(n1) [1 + z' + z'']
U11: runtime: ?, size: O(n1) [1 + z' + z'']

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: plus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + 7·z'

Computed RUNTIME bound using CoFloCo for: U12
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 4 + 7·z'

Computed RUNTIME bound using CoFloCo for: U11
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 7 + 7·z'

(24) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 3 }→ U12(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 3 }→ 1 + plus(z'', z') :|: z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
plus(z, z') -{ 1 }→ U11(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]
plus: runtime: O(n1) [1 + 7·z'], size: O(n1) [z + z']
U12: runtime: O(n1) [4 + 7·z'], size: O(n1) [1 + z' + z'']
U11: runtime: O(n1) [7 + 7·z'], size: O(n1) [1 + z' + z'']

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 7 + 7·z' }→ s :|: s >= 0, s <= 1 * z' + 1 * z'' + 1, z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 4 + 7·z' }→ 1 + s' :|: s' >= 0, s' <= 1 * z'' + 1 * z', z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 + 7·z' }→ s'' :|: s'' >= 0, s'' <= 1 * (z' - 1) + 1 * z + 1, z' - 1 >= 0, z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]
plus: runtime: O(n1) [1 + 7·z'], size: O(n1) [z + z']
U12: runtime: O(n1) [4 + 7·z'], size: O(n1) [1 + z' + z'']
U11: runtime: O(n1) [7 + 7·z'], size: O(n1) [1 + z' + z'']

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: U22
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: z'·z'' + z''

Computed SIZE bound using KoAT for: x
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: z + z·z'

Computed SIZE bound using KoAT for: U21
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: z'·z'' + z''

(28) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 7 + 7·z' }→ s :|: s >= 0, s <= 1 * z' + 1 * z'' + 1, z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 4 + 7·z' }→ 1 + s' :|: s' >= 0, s' <= 1 * z'' + 1 * z', z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 + 7·z' }→ s'' :|: s'' >= 0, s'' <= 1 * (z' - 1) + 1 * z + 1, z' - 1 >= 0, z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed: {U22,x,U21}
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]
plus: runtime: O(n1) [1 + 7·z'], size: O(n1) [z + z']
U12: runtime: O(n1) [4 + 7·z'], size: O(n1) [1 + z' + z'']
U11: runtime: O(n1) [7 + 7·z'], size: O(n1) [1 + z' + z'']
U22: runtime: ?, size: O(n2) [z'·z'' + z'']
x: runtime: ?, size: O(n2) [z + z·z']
U21: runtime: ?, size: O(n2) [z'·z'' + z'']

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: U22
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 6 + 9·z' + 7·z'·z'' + 7·z''

Computed RUNTIME bound using KoAT for: x
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 11 + 7·z + 7·z·z' + 9·z'

Computed RUNTIME bound using KoAT for: U21
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 9 + 9·z' + 7·z'·z'' + 7·z''

(30) Obligation:

Complexity RNTS consisting of the following rules:

U11(z, z', z'') -{ 7 + 7·z' }→ s :|: s >= 0, s <= 1 * z' + 1 * z'' + 1, z = 0, z' >= 0, z'' >= 0
U12(z, z', z'') -{ 4 + 7·z' }→ 1 + s' :|: s' >= 0, s' <= 1 * z'' + 1 * z', z = 0, z' >= 0, z'' >= 0
U21(z, z', z'') -{ 3 }→ U22(0, z', z'') :|: z = 0, z' >= 0, z'' >= 0
U22(z, z', z'') -{ 4 }→ plus(x(z'', z'), z'') :|: z = 0, z' >= 0, z'' >= 0
activate(z) -{ 1 }→ z :|: z >= 0
plus(z, z') -{ 1 + 7·z' }→ s'' :|: s'' >= 0, s'' <= 1 * (z' - 1) + 1 * z + 1, z' - 1 >= 0, z >= 0
plus(z, z') -{ 1 }→ z :|: z' = 0, z >= 0
x(z, z') -{ 1 }→ U21(0, z' - 1, z) :|: z' - 1 >= 0, z >= 0
x(z, z') -{ 1 }→ 0 :|: z' = 0, z >= 0

Function symbols to be analyzed:
Previous analysis results are:
activate: runtime: O(1) [1], size: O(n1) [z]
plus: runtime: O(n1) [1 + 7·z'], size: O(n1) [z + z']
U12: runtime: O(n1) [4 + 7·z'], size: O(n1) [1 + z' + z'']
U11: runtime: O(n1) [7 + 7·z'], size: O(n1) [1 + z' + z'']
U22: runtime: O(n2) [6 + 9·z' + 7·z'·z'' + 7·z''], size: O(n2) [z'·z'' + z'']
x: runtime: O(n2) [11 + 7·z + 7·z·z' + 9·z'], size: O(n2) [z + z·z']
U21: runtime: O(n2) [9 + 9·z' + 7·z'·z'' + 7·z''], size: O(n2) [z'·z'' + z'']

(31) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(32) BOUNDS(1, n^2)